requirejs.config({
    paths: {
        // ramda: `C:\Users\iot421\AppData\Local\Microsoft\TypeScript\4.3\node_modules\@types\ramda`,
        // ramda: `D:\school\跨平台\lab4\lab04.function.adv\node_modules\ramda\dist\ramda.min`,
        
        // // ramda: 'https://cdnjs.cloudflare.com/ajax/libs/ramda/0.13.0/ramda.min',
        // // jquery: 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min'
        // jquery: 'C:\Windows\servicing\LCU\Package_for_RollupFix~31bf3856ad364e35~amd64~~19041.1466.1.6\amd64_microsoft-windows-m..oolsclient.appxmain_31bf3856ad364e35_10.0.19041.423_none_9de80b9d881a1ebd\f\jquery-2.1.1.min',

        ramda: `js/ramda.min`,
        // jquery: 'js/jquery-2.1.1.min',
        // 二进制 假的
        jquery: 'js/jquery-1.10.1.min'
        
       
    }
});

require([
    'ramda',
    'jquery'
],
    function (_, $) {
        ////////////////////////////////////////////
        // Utils

        // 网页怎么 requeire 
        var Impure = {
            getJSON: _.curry(function (callback, url) {
                $.getJSON(url, callback);
            }),

            setHtml: _.curry(function (sel, html) {
                $(sel).html(html);
            })
        };

        var img = function (url) {
            console.log("url");
            console.log(url);
            return $('<img />', { src: url });
        };

        var trace = _.curry(function (tag, x) {
            console.log(tag, x);
            return x;
        });

        ////////////////////////////////////////////

        var url = function (t) {
            return 'https://api.flickr.com/services/feeds/photos_public.gne?tags=' + t + '&format=json&jsoncallback=?';
        };
        // 图片是json 形式？
        console.log("url");
        console.log(url);
        var mediaUrl = _.compose(_.prop('m'), _.prop('media'));

        console.log("mediaUrl");
        console.log(mediaUrl);
        // 啊这 中间的变量都打印不出 我都不知道这有什么好的。。。
        var srcs = _.compose(_.map(mediaUrl), _.prop('items'));

        var images = _.compose(_.map(img), srcs);

        var renderImages = _.compose(Impure.setHtml("body"), images);

        console.log("renderImages");
        console.log(renderImages);
        // 获得 url的json ？
        var app = _.compose(Impure.getJSON(renderImages), url);

        console.log("app cats");
        app("cats");
    });